package com.example.blog.utils;

import lombok.extern.slf4j.Slf4j;

import java.text.SimpleDateFormat;
import java.util.Date;

@Slf4j
public class DateUtils {
    public static String dateFormat(Date date){
        SimpleDateFormat dateFormat = null;
        try {
            dateFormat = new SimpleDateFormat("yyy-MM-dd HH:mm");
            return dateFormat.format(date);
        }catch (Exception e) {
            log.error("date must not be null");
            return null;
        }
    }
}
